/**
 * jquery-model.js
 * author  brose
 *
 **/
;(function(o) {
      o.fn.extend({
          modelDriver: function(obj) {
              var _this = this,
                  setting = obj || {};
              _this.find("[data-model]").each(function(index, item) {
                  var $item = $(item),
                      _nodeName = item.nodeName,
                      _modelName = $item.attr("data-model");
                  for (var i in setting) {
                      if (i === _modelName) {
                          if (_nodeName === "INPUT" || _nodeName === "SELECT") {
                              $item.val(obj[i]);
                          } else {
                              $item.text(obj[i]);
                          }
                      }
                  }
              })

          }
      });
  })($);
